package com.itheima.chapter03.characterstring;

import java.util.Scanner;

/*
    统计字符次数
 */
public class domestring5 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        System.out.println("请你输入一个字符串：");
        String line = sc.nextLine();
        int bigcount = 0;
        int smallcount = 0;
        int numcount = 0;
        for (int i = 0; i <line.length() ; i++) {
            char ch=line.charAt(i);
            if(ch>='a' && ch<='z'){
                smallcount++;
            }else if(ch>='A' && ch<='Z'){
                bigcount++;
            }else if(ch>='0' && ch<='9'){
                numcount++;
            }
        }
        System.out.println("大写字母"+bigcount+"个");
        System.out.println("小写字母"+smallcount+"个");
        System.out.println("数字"+numcount+"个");
    }
}
